/*
 *
我叫: 张飞， 我今年21
我正在吃烧烤
我叫: 刘备， 我今年28
我正在学习C++

 */
#include <iostream>
using namespace std;
class Student{
	private:
		string m_name;
		int m_age; 
		int m_no;
	public:
		void setName(const string& name){
			m_name = name;
		}
		void setAge(int age){
			if(age < 0)
				cout << "无效年龄" << endl;
			else
				m_age = age;
		}
		void setNo(int no){
			m_no = no;
		}
		void sleep(int hour){
			cout << "我睡了"<< hour <<"小时"<< endl;
		}
		void eat(const string &food){
			cout << "我正在吃" <<food << endl;
		}
		void learn(const string &course){
			cout << "我正在学习" << course << endl;
		}
		void who(){
			cout << "我叫: "<<m_name << "， 我今年" << m_age << endl; 
		}
};
int main(void){
	Student s1;
	s1.setName("张飞");
	s1.setAge(21);
	s1.setNo(10003);
	s1.who();
	s1.eat("烧烤");
	Student s2;
	s2.setName("刘备");
	s2.setAge(28);
	s2.setNo(10000);
	s2.who();
	s2.learn("C++");
	return 0;
}
